package com.linked.store.label.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.store.label.bean.param.PasteLabelParam;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author :dbq
 * @date : 2023/3/23 15:05
 * @description : desc
 */
@Data
@TableName("store_label_belong")
public class LabelBelongPO {

    @TableId(value = "label_belong_id", type = IdType.ASSIGN_UUID)
    private String labelBelongId;
    @TableField("belong_id")
    private String belongId;
    @TableField("label_id")
    private String labelId;

    @TableField("label_for")
    private Integer labelFor;
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public LabelBelongPO(PasteLabelParam param) {
        this.belongId = param.getBelongId();
        this.labelId = param.getLabelId();
        this.labelFor = param.getLabelFor();
    }
}
